<html>
<head>

		<?php
        INCLUDE 'header.php';
		
	//monto a consulta
	 $sql = "select * from fazenda";
	 //executo no banco, retornando os registros da tabela
	 $lista = pg_query($sql);
	 
	 ?>
     
	
		<title>Sistema de controle de fazendas</title>
		  </head>
		  <body>
		<div class="pull-right"> 
		<div class="btn" title="nova fazenda"><i class="icon-edit"></i><a></a></div>
		<div class="btn" title="sair"><i class="icon-share-alt"></i><a></a></div>
		</div>
		<legend><i class="icon-search"></i>Pesquisar fazendas</legend>
	  
		<form class="form-search">
	
		<input class="input-medium search-query" placeholder="faça sua busca"></input>
		<button class="btn btn-warning">buscar</button>
		</form>
	
		
	<table class="table table-hover">
    <caption></caption>
    <thead>
	 <tbody>
    <tr class="info">
    <th>Id</th>
    <th>Nome</th>
	<th>Localização</th>
	<th>Data abertura</th>
	<th>Hectares</th>
	<th>Ativo</th>
	<th>Situação financeira</th>
	<th>Ações</th>
    </tr>
    </thead>
   <?php
   while($fazenda = pg_fetch_assoc($lista))
   {
   
   ?>
    <tr>
    <td><?php echo $fazenda ["idfazenda"]?></td>
    <td><?php echo $fazenda ["nome"]?></td>
	<td><?php echo $fazenda ["localizacao"]?></td>
	<td><?php echo $fazenda ["dataabertura"]?></td>
    <td><?php echo $fazenda ["hectares"]?></td>
	<td><?php echo $fazenda ["ativo"]?></td>
	<td><?php echo $fazenda ["situacaofinanceira"]?></td>
	<td><a title="excluir" href="excluirAnimal.php"><i class="icon-trash"></i></a>
	<a title="alterar" href="editarFazenda.php"><i class="icon-pencil"></i></a></td>
    </tr>
	<?php
	}
	?>
    </tbody>
    </table>
    </table>
	</body>
</html>
<!--youtube.com/programatcheif-->